home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
026-050
/
049
/
cycloids
/
hypocycloid3.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-13
|
26KB
|
849 lines
/* hypocycloid3.c */
/* based on the articles on cycloids in Creative Computing May-June 1984
and the article in February 1984 BYTE "Five Original Graphics" */
void IMsg();
int stopcheck();
/* Include the definitions and functions we need */
#include "hypocycloid2.h"
#include "hypo2.c"
#include "palette.c"
#include "save.c"
#include "newradii.c"
struct IntuiText Menu0IText [] = {
{
0,3,JAM2, /* Front Pen, Back Pen, Draw Mode */
0,0, /* Left Edge, Top Edge */
&TestFont, /* pointer to Text Font */
" new ", /* text of Menu Item */
NULL /* pointer to next IText */
},
{0,3,JAM2,0,0,&TestFont," go ",NULL },
{0,3,JAM2,0,0,&TestFont,"stop ",NULL },
{0,3,JAM2,0,0,&TestFont,"cycle",NULL },
{0,3,JAM2,0,0,&TestFont,"color",NULL },
{0,3,JAM2,0,0,&TestFont,"save ",NULL },
{0,3,JAM2,0,0,&TestFont,"clear",NULL },
{0,3,JAM2,0,0,&TestFont,"quit ",NULL },
};
struct MenuItem Menu0Item[8] = {
{
&Menu0Item[1], /* pointer to next Item */
0,0,50,9, /* Left, Top, Width, Height */
ITEMTEXT | ITEMENABLED | HIGHCOMP, /* Flags */
0, /* no mutual exclude */
(APTR)&Menu0IText[0], /* Render info */
NULL,NULL,NULL, /*Alt Image, Command (amiga) char, subitem*/
MENUNULL /* next select */
},
{&Menu0Item[2],0,9,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
0,(APTR)&Menu0IText[1],NULL,NULL,NULL,MENUNULL},
{&Menu0Item[3],0,18,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
0,(APTR)&Menu0IText[2],NULL,NULL,NULL,MENUNULL},
{&Menu0Item[4],0,27,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
0,(APTR)&Menu0IText[3],NULL,NULL,NULL,MENUNULL},
{&Menu0Item[5],0,36,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
0,(APTR)&Menu0IText[4],NULL,NULL,NULL,MENUNULL},
{&Menu0Item[6],0,45,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
0,(APTR)&Menu0IText[5],NULL,NULL,NULL,MENUNULL},
{&Menu0Item[7],0,54,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
0,(APTR)&Menu0IText[6],NULL,NULL,NULL,MENUNULL},
{NULL,0,63,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
0,(APTR)&Menu0IText[7],NULL,NULL,NULL,MENUNULL}
};
struct IntuiText Menu1IText [] = {
{
0,3,JAM2, /* Front Pen, Back Pen, Draw Mode */
0,0, /* Left Edge, Top Edge */
&TestFont, /* pointer to Text Font */
" 0.00", /* text of Menu Item */
NULL /* pointer to next IText */
},
{0,3,JAM2,0,0,&TestFont," 0.25",NULL },
{0,3,JAM2,0,0,&TestFont," 0.50",NULL },
{0,3,JAM2,0,0,&TestFont," 0.75",NULL },
{0,3,JAM2,0,0,&TestFont," 1.00",NULL },
{0,3,JAM2,0,0,&TestFont," 1.25",NULL },
{0,3,JAM2,0,0,&TestFont," 1.50",NULL },
{0,3,JAM2,0,0,&TestFont," 1.75",NULL },
{0,3,JAM2,0,0,&TestFont," 2.00",NULL },
{0,3,JAM2,0,0,&TestFont," 2.50",NULL },
};
struct MenuItem Menu1Item[10] = {
{
&Menu1Item[1], /* pointer to next Item */
0,0,50,9, /* Left, Top, Width, Height */
ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT, /* Flags */
(~(1 << 0)), /* mutual exclude */
(APTR)&Menu1IText[0], /* Render info */
NULL,NULL,NULL, /*Alt Image, Command (amiga) char, subitem*/
MENUNULL /* next select */
},
{&Menu1Item[2],0,9,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 1)),(APTR)&Menu1IText[1],NULL,NULL,NULL,MENUNULL},
{&Menu1Item[3],0,18,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 2)),(APTR)&Menu1IText[2],NULL,NULL,NULL,MENUNULL},
{&Menu1Item[4],0,27,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 3)),(APTR)&Menu1IText[3],NULL,NULL,NULL,MENUNULL},
{&Menu1Item[5],0,36,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | CHECKED,
(~(1 << 4)),(APTR)&Menu1IText[4],NULL,NULL,NULL,MENUNULL},
{&Menu1Item[6],0,45,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 5)),(APTR)&Menu1IText[5],NULL,NULL,NULL,MENUNULL},
{&Menu1Item[7],0,54,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 6)),(APTR)&Menu1IText[6],NULL,NULL,NULL,MENUNULL},
{&Menu1Item[8],0,63,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 7)),(APTR)&Menu1IText[7],NULL,NULL,NULL,MENUNULL},
{&Menu1Item[9],0,72,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 8)),(APTR)&Menu1IText[8],NULL,NULL,NULL,MENUNULL},
{NULL,0,81,50,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 9)),(APTR)&Menu1IText[9],NULL,NULL,NULL,MENUNULL}
};
struct IntuiText Menu2IText [] = {
{
0,3,JAM2, /* Front Pen, Back Pen, Draw Mode */
0,0, /* Left Edge, Top Edge */
&TestFont, /* pointer to Text Font */
" 0%", /* text of Menu Item */
NULL /* pointer to next IText */
},
{0,3,JAM2,0,0,&TestFont," 10%",NULL },
{0,3,JAM2,0,0,&TestFont," 20%",NULL },
{0,3,JAM2,0,0,&TestFont," 30%",NULL },
};
struct MenuItem Menu2Item[4] = {
{
&Menu2Item[1], /* pointer to next Item */
0,0,40,9, /* Left, Top, Width, Height */
ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT, /* Flags */
(~(1 << 0)), /* mutual exclude */
(APTR)&Menu2IText[0], /* Render info */
NULL,NULL,NULL, /*Alt Image, Command (amiga) char, subitem*/
MENUNULL /* next select */
},
{&Menu2Item[2],0,9,40,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | CHECKED,
(~(1 << 1)),(APTR)&Menu2IText[1],NULL,NULL,NULL,MENUNULL},
{&Menu2Item[3],0,18,40,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 2)),(APTR)&Menu2IText[2],NULL,NULL,NULL,MENUNULL},
{NULL,0,27,40,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 3)),(APTR)&Menu2IText[3],NULL,NULL,NULL,MENUNULL}
};
struct IntuiText Menu3IText [] = {
{
0,3,JAM2, /* Front Pen, Back Pen, Draw Mode */
0,0, /* Left Edge, Top Edge */
&TestFont, /* pointer to Text Font */
" 10%", /* text of Menu Item */
NULL /* pointer to next IText */
},
{0,3,JAM2,0,0,&TestFont," 20%",NULL },
{0,3,JAM2,0,0,&TestFont," 30%",NULL },
{0,3,JAM2,0,0,&TestFont," 40%",NULL },
{0,3,JAM2,0,0,&TestFont," 50%",NULL },
{0,3,JAM2,0,0,&TestFont," 60%",NULL },
{0,3,JAM2,0,0,&TestFont," 70%",NULL },
{0,3,JAM2,0,0,&TestFont," 80%",NULL },
};
struct MenuItem Menu3Item[8] = {
{
&Menu3Item[1], /* pointer to next Item */
0,0,40,9, /* Left, Top, Width, Height */
ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT, /* Flags */
(~(1 << 0)), /* mutual exclude */
(APTR)&Menu3IText[0], /* Render info */
NULL,NULL,NULL, /*Alt Image, Command (amiga) char, subitem*/
MENUNULL /* next select */
},
{&Menu3Item[2],0,9,40,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 1)),(APTR)&Menu3IText[1],NULL,NULL,NULL,MENUNULL},
{&Menu3Item[3],0,18,40,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 2)),(APTR)&Menu3IText[2],NULL,NULL,NULL,MENUNULL},
{&Menu3Item[4],0,27,40,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 3)),(APTR)&Menu3IText[3],NULL,NULL,NULL,MENUNULL},
{&Menu3Item[5],0,36,40,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | CHECKED,
(~(1 << 4)),(APTR)&Menu3IText[4],NULL,NULL,NULL,MENUNULL},
{&Menu3Item[6],0,45,40,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 5)),(APTR)&Menu3IText[5],NULL,NULL,NULL,MENUNULL},
{&Menu3Item[7],0,54,40,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 6)),(APTR)&Menu3IText[6],NULL,NULL,NULL,MENUNULL},
{NULL,0,63,40,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 7)),(APTR)&Menu3IText[7],NULL,NULL,NULL,MENUNULL}
};
struct IntuiText Menu4IText [] = {
{
0,3,JAM2, /* Front Pen, Back Pen, Draw Mode */
0,0, /* Left Edge, Top Edge */
&TestFont, /* pointer to Text Font */
" 0", /* text of Menu Item */
NULL /* pointer to next IText */
},
{0,3,JAM2,0,0,&TestFont," 3",NULL },
{0,3,JAM2,0,0,&TestFont," 6",NULL },
{0,3,JAM2,0,0,&TestFont," 9",NULL },
{0,3,JAM2,0,0,&TestFont," 12",NULL },
{0,3,JAM2,0,0,&TestFont," 15",NULL },
{0,3,JAM2,0,0,&TestFont," 18",NULL },
{0,3,JAM2,0,0,&TestFont," 21",NULL },
{0,3,JAM2,0,0,&TestFont," 24",NULL },
{0,3,JAM2,0,0,&TestFont," 30",NULL },
};
struct MenuItem Menu4Item[10] = {
{
&Menu4Item[1], /* pointer to next Item */
0,0,30,9, /* Left, Top, Width, Height */
ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT, /* Flags */
(~(1 << 0)), /* mutual exclude */
(APTR)&Menu4IText[0], /* Render info */
NULL,NULL,NULL, /*Alt Image, Command (amiga) char, subitem*/
MENUNULL /* next select */
},
{&Menu4Item[2],0,9,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 1)),(APTR)&Menu4IText[1],NULL,NULL,NULL,MENUNULL},
{&Menu4Item[3],0,18,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 2)),(APTR)&Menu4IText[2],NULL,NULL,NULL,MENUNULL},
{&Menu4Item[4],0,27,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | CHECKED,
(~(1 << 3)),(APTR)&Menu4IText[3],NULL,NULL,NULL,MENUNULL},
{&Menu4Item[5],0,36,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 4)),(APTR)&Menu4IText[4],NULL,NULL,NULL,MENUNULL},
{&Menu4Item[6],0,45,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 5)),(APTR)&Menu4IText[5],NULL,NULL,NULL,MENUNULL},
{&Menu4Item[7],0,54,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 6)),(APTR)&Menu4IText[6],NULL,NULL,NULL,MENUNULL},
{&Menu4Item[8],0,63,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 7)),(APTR)&Menu4IText[7],NULL,NULL,NULL,MENUNULL},
{&Menu4Item[9],0,72,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 8)),(APTR)&Menu4IText[8],NULL,NULL,NULL,MENUNULL},
{NULL,0,81,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 9)),(APTR)&Menu4IText[9],NULL,NULL,NULL,MENUNULL}
};
struct IntuiText Menu5IText [] = {
{
0,3,JAM2, /* Front Pen, Back Pen, Draw Mode */
0,0, /* Left Edge, Top Edge */
&TestFont, /* pointer to Text Font */
" 1", /* text of Menu Item */
NULL /* pointer to next IText */
},
{0,3,JAM2,0,0,&TestFont," 2",NULL },
{0,3,JAM2,0,0,&TestFont," 3",NULL },
{0,3,JAM2,0,0,&TestFont," 4",NULL },
{0,3,JAM2,0,0,&TestFont," 5",NULL },
{0,3,JAM2,0,0,&TestFont," 6",NULL },
{0,3,JAM2,0,0,&TestFont," 7",NULL },
{0,3,JAM2,0,0,&TestFont," 8",NULL },
{0,3,JAM2,0,0,&TestFont," 9",NULL },
{0,3,JAM2,0,0,&TestFont," 10",NULL },
};
struct MenuItem Menu5Item[10] = {
{
&Menu5Item[1], /* pointer to next Item */
0,0,30,9, /* Left, Top, Width, Height */
ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT, /* Flags */
(~(1 << 0)), /* mutual exclude */
(APTR)&Menu5IText[0], /* Render info */
NULL,NULL,NULL, /*Alt Image, Command (amiga) char, subitem*/
MENUNULL /* next select */
},
{&Menu5Item[2],0,9,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 1)),(APTR)&Menu5IText[1],NULL,NULL,NULL,MENUNULL},
{&Menu5Item[3],0,18,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 2)),(APTR)&Menu5IText[2],NULL,NULL,NULL,MENUNULL},
{&Menu5Item[4],0,27,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | CHECKED,
(~(1 << 3)),(APTR)&Menu5IText[3],NULL,NULL,NULL,MENUNULL},
{&Menu5Item[5],0,36,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 4)),(APTR)&Menu5IText[4],NULL,NULL,NULL,MENUNULL},
{&Menu5Item[6],0,45,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 5)),(APTR)&Menu5IText[5],NULL,NULL,NULL,MENUNULL},
{&Menu5Item[7],0,54,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 6)),(APTR)&Menu5IText[6],NULL,NULL,NULL,MENUNULL},
{&Menu5Item[8],0,63,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 7)),(APTR)&Menu5IText[7],NULL,NULL,NULL,MENUNULL},
{&Menu5Item[9],0,72,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 8)),(APTR)&Menu5IText[8],NULL,NULL,NULL,MENUNULL},
{NULL,0,81,30,9,ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
(~(1 << 9)),(APTR)&Menu5IText[9],NULL,NULL,NULL,MENUNULL}
};
struct Menu BdMenu[6] = {
{
&BdMenu[1], /* ptr to next Menu */
5,0,50,0, /* left,top,width,height--top and height ignored */
MENUENABLED, /* Flags */
"Main ", /* menu title */
&Menu0Item[0] /* First Item in list */
},
{&BdMenu[2],65,0,50,0,MENUENABLED," > < ",&Menu1Item[0]},
{&BdMenu[3],125,0,40,0,MENUENABLED,"-> <",&Menu2Item[0]},
{&BdMenu[4],175,0,40,0,MENUENABLED,"> <-",&Menu3Item[0]},
{&BdMenu[5],225,0,30,0,MENUENABLED,">>°",&Menu4Item[0]},
{NULL,265,0,50,0,MENUENABLED,"#COLS",&Menu5Item[0]}
};
int an,bd,col,cycle,cc,delay,ex,rr;
double bf,bl,cf,dd,l,z;
extern int aa,bb;
int sav;
UWORD color18, color19;
main()
{
USHORT drawing;
drawing=1;
delay=9000;
cycle=0;
col=4;
ex=0;
cc=1.0;
an=9;
rr=1;
bd=1;
dd=360.0;
bf=.1;
cf=.5;
l=0;
bl=1.0;
z=1;
aa=5;
bb=2;
initwind();
init_colors();
init_scr();
fillscreen();
precalculate();
doepic();
while(drawing){
IMsg();
}
} /* end of main */
void IMsg()
{
struct IntuiMessage *BdMsg; /* Intuition message structure */
ULONG Mclass; /* Message class */
USHORT Mcode; /* Message code */
if (cycle==1)
cyclecolors();
while (BdMsg = (struct IntuiMessage *)GetMsg(w->UserPort))
{
Mclass = BdMsg->Class;
Mcode = BdMsg->Code;
ReplyMsg(BdMsg);
switch (Mclass) {
case CLOSEWINDOW:
clear_colors();
Cleanup();
exit(TRUE);
break;
case MENUPICK:
switch (MENUNUM(Mcode)){
case 0:
switch (ITEMNUM(Mcode)){
case 0:
newradii(w);
break;
case 1:
doepic();
break;
case 2:
break;
case 3:
if (cycle==0)
cycle=1;
else
cycle=0;
break;
case 4:
palette(w);
break;
case 5:
sav=save(w);
if (sav == 1){
color18=GetRGB4(p_Co,18);
color19=GetRGB4(p_Co,19);
SetRGB4(vp,18,15,0,0); /* red */
SetRGB4(vp,19,15,15,15); /* white */
SetPointer(w,&PointImage,14,16,0,0);
SavePicture();
ClearPointer(w);
*(p_ct+18)=(USHORT)color18;
*(p_ct+19)=(USHORT)color19;
LoadRGB4(vp,p_ct,CTSIZ);
}
break;
case 6:
fillscreen();
break;
case 7:
clear_colors();
Cleanup();
exit(TRUE);
break;
}
break;
case 1:
switch (ITEMNUM(Mcode)){
case 0:
cc=0;
break;
case 1:
cc=.25;
break;
case 2:
cc=.5;
break;
case 3:
cc=.75;
break;
case 4:
cc=1.0;
break;
case 5:
cc=1.25;
break;
case 6:
cc=1.5;
break;
case 7:
cc=1.75;
break;
case 8:
cc=2.0;
break;
case 9:
cc=2.5;
break;
}
break;
case 2:
switch (ITEMNUM(Mcode)){
case 0:
bf=0;
break;
case 1:
bf=.1;
break;
case 2:
bf=.2;
break;
case 3:
bf=.3;
break;
}
break;
case 3:
switch (ITEMNUM(Mcode)){
case 0:
cf=.1;
break;
case 1:
cf=.2;
break;
case 2:
cf=.3;
break;
case 3:
cf=.4;
break;
case 4:
cf=.5;
break;
case 5:
cf=.6;
break;
case 6:
cf=.7;
break;
case 7:
cf=.8;
break;
}
break;
case 4:
switch (ITEMNUM(Mcode)){
case 0:
an=0;
break;
case 1:
an=3;
break;
case 2:
an=6;
break;
case 3:
an=9;
break;
case 4:
an=12;
break;
case 5:
an=15;
break;
case 6:
an=18;
break;
case 7:
an=21;
break;
case 8:
an=24;
break;
case 9:
an=30;
break;
}
break;
case 5:
switch (ITEMNUM(Mcode)){
case 0:
col=1;
break;
case 1:
col=2;
break;
case 2:
col=3;
break;
case 3:
col=4;
break;
case 4:
col=5;
break;
case 5:
col=6;
break;
case 6:
col=7;
break;
case 7:
col=8;
break;
case 8:
col=9;
break;
case 9:
col=10;
break;
}
break;
}
}
/* end of Class switch */
}/* while */
}
init_scr()
{
SetMenuStrip(w,&BdMenu);
} /* end of init_scr */
Cleanup()
{
CloseWindow(w);
CloseScreen(screen);
}
cyclecolors()
{
int i,temp;
temp=*(p_ct+5);
for (i=5;i<=30;i++)
*(p_ct+i)=*(p_ct+i+1);
*(p_ct+31)=temp;
LoadRGB4(vp,p_ct,CTSIZ);
for (i=0;i<=delay;i++)
;
}
int stopcheck()
{
struct IntuiMessage *BdMsg; /* Intuition message structure */
ULONG Mclass; /* Message class */
USHORT Mcode,ItemNum;
ex = 0;
while (BdMsg = (struct IntuiMessage *)GetMsg(w->UserPort))
{
Mclass = BdMsg->Class;
Mcode = BdMsg->Code;
ReplyMsg(BdMsg);
switch (Mclass) {
case CLOSEWINDOW:
clear_colors();
Cleanup();
exit(TRUE);
break;
case MENUPICK:
switch (MENUNUM(Mcode)){
case 0:
ItemNum = ITEMNUM(Mcode);
switch (ItemNum){
case 0:
newradii(w);
break;
case 1:
break;
case 2:
ex = 1;
break;
case 3:
if (cycle==0)
cycle=1;
else
cycle=0;
break;
case 4:
palette(w);
break;
case 5:
sav=save(w);
if (sav==1){
color18=GetRGB4(p_Co,18);/* save current color 18 */
color19=GetRGB4(p_Co,19);/* save current color 19 */
SetRGB4(vp,18,15,0,0); /* red */
SetRGB4(vp,19,15,15,15); /* white */
SetPointer(w,&PointImage,14,16,0,0);
SavePicture();
ClearPointer(w);
*(p_ct+18)=(USHORT)color18;
*(p_ct+19)=(USHORT)color19;
LoadRGB4(vp,p_ct,CTSIZ); /* restore color table */
}
break;
case 6:
fillscreen();
break;
case 7:
clear_colors();
Cleanup();
exit(TRUE);
}
break;
case 1:
switch (ITEMNUM(Mcode)){
case 0:
cc=0;
break;
case 1:
cc=.25;
break;
case 2:
cc=.5;
break;
case 3:
cc=.75;
break;
case 4:
cc=1.0;
break;
case 5:
cc=1.25;
break;
case 6:
cc=1.5;
break;
case 7:
cc=1.75;
break;
case 8:
cc=2.0;
break;
case 9:
cc=2.5;
break;
}
break;
case 2:
switch (ITEMNUM(Mcode)){
case 0:
bf=0;
break;
case 1:
bf=.1;
break;
case 2:
bf=.2;
break;
case 3:
bf=.3;
break;
}
break;
case 3:
switch (ITEMNUM(Mcode)){
case 0:
cf=.1;
break;
case 1:
cf=.2;
break;
case 2:
cf=.3;
break;
case 3:
cf=.4;
break;
case 4:
cf=.5;
break;
case 5:
cf=.6;
break;
case 6:
cf=.7;
break;
case 7:
cf=.8;
break;
}
break;
case 4:
switch (ITEMNUM(Mcode)){
case 0:
an=0;
break;
case 1:
an=3;
break;
case 2:
an=6;
break;
case 3:
an=9;
break;
case 4:
an=12;
break;
case 5:
an=15;
break;
case 6:
an=18;
break;
case 7:
an=21;
break;
case 8:
an=24;
break;
case 9:
an=30;
break;
}
break;
case 5:
switch (ITEMNUM(Mcode)){
case 0:
col=1;
break;
case 1:
col=2;
break;
case 2:
col=3;
break;
case 3:
col=4;
break;
case 4:
col=5;
break;
case 5:
col=6;
break;
case 6:
col=7;
break;
case 7:
col=8;
break;
case 8:
col=9;
break;
case 9:
col=10;
break;
}
break;
}
}
}/* while */
return(ex);
}